<!--管理员主页面-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.sql.*,org.edu.system.DBConnect,java.util.Date"%>
<%
	String adm_id = (String) (session.getAttribute("UserName"));
	String sql = "SELECT * FROM administrator WHERE adm_id = '" + adm_id + "'";
	System.out.println(sql);

	Connection con = DBConnect.getCon();
	Statement stmt = null;
	ResultSet rs = null;
	stmt = con.createStatement();
	rs = stmt.executeQuery(sql);//执行命令
	if (rs.next())// 如果记录集非空，表明有匹配的用户ID
	{
		//正常进行
	} else {
		// 否则登录失败
		// response.sendRedirect ( "MyJsp.jsp" );
		response.sendRedirect("login_failure.jsp");
	}
%>
<!DOCTYPE html>
<html>
<head>
<link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="./bootstrap/js/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
<title>管理员后台系统</title>
</head>
<body style="width: 1000px; margin: 0 auto;">
	<div id="header">
		<table border="0" width="100%">
			<tr>
				<td>
				<div class="page-header">
					<%
					String username = null;
					sql = "SELECT adm_id FROM administrator WHERE adm_id = '" + adm_id + "'";
					stmt = null;
					rs = null;
					stmt = con.createStatement();
					rs = stmt.executeQuery(sql);//执行命令
					if (rs.next())// 如果记录集非空，表明有匹配的用户ID
					{
						username = rs.getString("adm_id");
					}
					%>
  					<h1>管理员后台系统 <small>您好啊，<%=username%></small></h1>
				</div>
				</td>
				<td align="right">
				<div><a href="./logout.jsp" style="font-size:15px">注销</a></div>
				</td>
			</tr>
		</table>
	</div>
	<div id="navigation">
		<ul id="myTab" class="nav nav-tabs">
		  <li role="presentation" class="active"><a href="adm_student_info.jsp" target="iframe1">学生管理</a></li>
		  <li role="presentation"><a href="adm_teacher_info.jsp" target="iframe1">教师管理</a></li>
		  <li role="presentation"><a href="adm_course_info.jsp" target="iframe1">课程管理</a></li>
		  <li role="presentation"><a href="adm_sk_info.jsp" target="iframe1">授课管理</a></li>
		  <li role="presentation"><a href="adm_info.jsp" target="iframe1">个人信息</a></li>
		</ul>
	</div>
	<div id="container">
		<iframe name="iframe1" id="iframe1" src="adm_student_info.jsp" frameborder="no" width="100%" height="800px"
			scrolling="yes"></iframe>
	</div>
	<div id="botton">
		<table height="80px">
			<td style="text-align: center;">版权所属</td>
		</table>
	</div>
	<script> 
      $(function () { 
        $('#myTab a:first').tab('show');//初始化显示哪个tab 
      
        $('#myTab a').click(function (e) { 
          $(this).tab('show');//显示当前选中的链接及关联的content 
        }) 
      }) 
    </script>
</body>
</html>